var app = getApp()
var tuiModel = require("../../model/tuiModel.js")
var util = require("../../utils/util.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    total: 0,
    frozen: 0,
    balance: 0,
    apply: 0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    this.init()
  },
  init() {
    var that = this
    util.showLoading("加载中")
    tuiModel.sumTuiAward(res => {
      wx.hideLoading()
      if (res.status == 0)
        that.setData({
          balance: res.data.balance,
          frozen: res.data.frozen,
          total: res.data.total,
          apply: res.data.apply,
        })
    })
  }
})